package cn.mulanbay.common.bean;

/**
 * 查询列表通用基类
 *
 * @author fenghong
 * @create 2022-01-16 10:00
 */
public class PageSearch {

    /**
     * 页码
     */
    protected Integer page;

    /**
     * 单页显示条数
     */
    protected Integer pageSize = 20;

    /**
     * 是否需要总页数，移动端可以不需要这个
     */
    protected boolean needTotal = true;

    /**
     * 默认是第一页
     *
     * @return
     */
    public Integer getPage() {
        if (page == null) {
            return 1;
        }
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public boolean isNeedTotal() {
        return needTotal;
    }

    public void setNeedTotal(boolean needTotal) {
        this.needTotal = needTotal;
    }

}
